home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir26
/
epi601_2.zip
/
FILES06.EXE
/
ENTFACE.ASM
< prev
next >
Wrap
Assembly Source File
|
1994-08-22
|
3KB
|
69 lines
;======================================================================
; This program demonstrates the calling sequence for a user-supplied
; module for the ENTER program. The procedure must a binary file with
; its entry point at location 0 in the file. The ENTER program passes
; the following information in the locations specified (assuming the
; routine does the standard PUSH BP MOV BP,SP on entry):
;
; [BP+20] - A pointer to the questionnaire's record structure
; [BP+16] - A pointer to the global variable list
; [BP+12] - A pointer to the questionnaire's circular list header
; [BP+08] - A pointer to the current node in the questionnaire
; [BP+06] - An integer specified in the .CHK file to be passed
;
; The program is expected to return a value in AX as follows:
; 0 - No error
; 1 - Make user enter field again
;======================================================================
ORG 0
_Prog SEGMENT Byte
ASSUME CS:_Prog
Custom PROC FAR
PUSH BP
MOV BP,SP
MOV AX,WORD PTR [BP+06] ;Get interrupt number
PUSH DS ;Save DS
MOV AH,35h ;Get interrupt function num
INT 21h ;Call dos
ADD BX,5 ;Increment offset by 5
MOV DI,BX ;Set up for CMPS
MOV DX,CS ;Load code segment address
MOV DS,DX ;Load to DS
MOV SI,OFFSET IdString ;Load IDString address to DS:SI
MOV CX,5 ;Length of ID string
CLD
REPE CMPSB
JNE ErrorRet ;If not the right ID, exit
MOV AX,ES:[DI] ;Get old value of DS to AX
ADD DI,2 ;Increment to point to routine
LDS SI,[BP+20] ;Get parameters and push back
PUSH DS
PUSH SI
LDS SI,[BP+16]
PUSH DS
PUSH SI
LDS SI,[BP+12]
PUSH DS
PUSH SI
LDS SI,[BP+08]
PUSH DS
PUSH SI
MOV BX,[BP+06]
PUSH BX
MOV DS,AX ;Restore old DS
CALL DWORD PTR ES:[DI] ;Call far to correct location
JMP SHORT Return ;Skip over error result set
ErrorRet: MOV AX,4 ;Set error value
Return: POP DS ;Restore Enter's DS
POP BP
RETF 18
IDString DB 'ENTER'
Custom ENDP
_Prog ENDS
END